package com.xli.mis.codeitems.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.xli.mis.codeitems.entity.CodeItems;
import jakarta.validation.constraints.NotNull;

import java.util.List;


public interface ICodeItemsService extends IService<CodeItems> {

    boolean insert(@NotNull CodeItems codeItems);

    boolean delete(@NotNull Long id);

    boolean deleteByCodeId(@NotNull Long id);

    boolean update(@NotNull CodeItems codeItems);

    CodeItems find(@NotNull Long id);

    List<CodeItems> findList(@NotNull QueryWrapper<CodeItems> qw);

    Page<CodeItems> findList(@NotNull QueryWrapper<CodeItems> qw, @NotNull long current, @NotNull long size);

    long findCount(@NotNull QueryWrapper<CodeItems> qw);

    List<CodeItems> findItemListByCodeId(@NotNull Long codeId);

    List<CodeItems> findItemListByCodeName(@NotNull String codeName);

    boolean isExists(@NotNull Long codeId, @NotNull String value);

    String findItemTextByValue(@NotNull String codeName, @NotNull String itemValue);
}
